using UnityEngine;

public class StageGroupLine : MonoBehaviour
{
	public UILabel label;

	public UISprite line;

	public UISprite leftEdge;

	public UISprite rightEdge;

	public int additionalWidth = 300;

	public int sizeQuant = 32;

	public void Init(PlayerCareerStageDefinition.StageGroupDefinition group, int minx, int maxx, float height)
	{
		maxx += additionalWidth;
		minx -= additionalWidth;
		base.gameObject.SetActive(true);
		label.text = group.name.ToUpper();
		line.color = Color.Lerp(group.color, Color.black, 0.25f);
		UISprite uISprite = leftEdge;
		Color color = group.color;
		rightEdge.color = color;
		uISprite.color = color;
		UIWidget component = GetComponent<UIWidget>();
		Vector3 localPosition = component.cachedTransform.localPosition;
		localPosition.x = group.position.x;
		localPosition.y = group.position.y;
		component.cachedTransform.localPosition = localPosition;
		localPosition.y = 0f;
		line.width = Mathf.CeilToInt(Mathf.Abs(maxx - minx) / sizeQuant) * sizeQuant;
		localPosition.x = 0f - group.position.x + (float)(maxx + minx) * 0.5f;
		line.cachedTransform.localPosition = localPosition;
		leftEdge.height = Mathf.FloorToInt(height);
		rightEdge.height = Mathf.FloorToInt(height);
	}
}
